# coding: utf-8
from marshmallow import Schema, fields
from model.model_base import Base
from sqlalchemy import Column, String, Integer, DateTime


class PendingProDet(Base):
    # 待处理问题明细（督办）
    __tablename__ = 'PendingProDet'
    bureauid = Column(String(2), primary_key=True, comment='供电局编号')
    bureauname = Column(String(50), nullable=True, comment='供电局名称')
    stationid = Column(String(2), primary_key=True, comment='供所编号')
    stationname = Column(String(50), nullable=True, comment='供电所名称')
    meter_barcode = Column(String(22), primary_key=True, comment='电能表条码号')
    problemid = Column(String(2), nullable=True, comment='问题编号')
    problemname = Column(String(50), nullable=True, comment='问题名称')
    initial_time = Column(DateTime, nullable=True, comment='问题发现时间')
    pending_days = Column(Integer, nullable=True, comment='持续未处理天数')
    operationNo = Column(Integer, nullable=True, comment='运维部督办次数')
    directorNo = Column(Integer, nullable=True, comment='营销主任督办次数')
    leaderNo = Column(Integer, nullable=True, comment='营销局长督办次数')
    photo_fingerprint = Column(String(100), nullable=True, comment='图片指纹')
    monitorNo = Column(Integer, nullable=True, comment='计量班长督办次数')
    resolventid = Column(String(2), nullable=True, comment='解决方法编号')
    resolname = Column(String(50), nullable=False, comment='解决方法名称')
    remark = Column(String(200), nullable=True, comment='备注')

class PendingProDetSchema(Schema):
    bureauid = fields.String()
    bureauname = fields.String()
    stationid = fields.String()
    stationname = fields.String()
    meter_barcode = fields.String()
    problemid = fields.String()
    problemname = fields.String()
    initial_time = fields.DateTime(format="%Y-%m-%d %H:%M:%S.%f")
    pending_days = fields.Integer()
    operationNo = fields.Integer()
    directorNo = fields.Integer()
    leaderNo = fields.Integer()
    photo_fingerprint=fields.String()
    monitorNo = fields.Integer()
    resolventid = fields.String()
    resolname = fields.String()
    remark = fields.String()

pendingProDetSchema = PendingProDetSchema()





